package com.star.modules.sys.api;

import com.jeesite.common.entity.Page;
import com.star.modules.sys.base.BizDataResult;
import com.star.modules.sys.entity.ShHouse;
import com.star.modules.sys.service.BottomService;
import com.star.modules.sys.service.GlodHouseService;
import com.star.modules.sys.service.ShHouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 底部接口
 */
@RestController
@RequestMapping(value = "${frontPath}/sys/house")
public class GlodHouseController {

    @Autowired
    private GlodHouseService glodHouseService;


    /**
     * 首页展示信息
     *
     * @return
     */
    @RequestMapping(value = "dictInfo")
    public BizDataResult getIndexInfo(HttpServletRequest request, HttpServletResponse response) {
        return glodHouseService.getHouseDict();
    }

    /**
     * 房源列表
     * @param shHouse
     * @param page
     * @return
     */
    @RequestMapping(value = "listHouse")
    public BizDataResult getHouses(ShHouse shHouse, Page page) {
        return glodHouseService.getHouse(shHouse, page);
    }

    /**
     * 房源详情
     * @param id
     * @return
     */
    @RequestMapping(value = "houseDetail")
    public BizDataResult getHouseDetail(String id) {
        return glodHouseService.getHouseDetail(id);
    }
}
